﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Web;
using FaceSharp.Api.RestApi;

namespace FaceSharp.Api.Objects
{
    public class Dashboard : RestBase
    {
        public Dashboard(IFacebookCore facebookCore) : base(facebookCore)
        {
        }

        public void DecrementCount()
        {
            Trace.Write("Begin Request", "GraphApi.DashboardDecrementCount");
            MakeRestRequest("dashboard.decrementCount");
            Trace.Write("End Request", "GraphApi.DashboardDecrementCount");
        }

        public void SetCount(long count)
        {
            Trace.Write("Begin Request", "GraphApi.DashboardSetCount");
            MakeRestRequest("dashboard.decrementCount", new Dictionary<string, string>()
                                                           {
                                                               {"count",count.ToString()}
                                                           });
            Trace.Write("End Request", "GraphApi.DashboardSetCount");
        }

        /// <summary>
        /// Calling GraphApi.DashboardIncrementCount against another user
        /// </summary>
        /// <param name="userId"></param>
        public void IncrementCount(long userId)
        {
            Trace.Write("Begin Request", "GraphApi.DashboardIncrementCount");
            MakeRestRequest("dashboard.incrementCount", new Dictionary<string, string>()
                                                           {
                                                               {"uid",userId.ToString()}
                                                           }, signRequest: true);

            Trace.Write("End Request", "GraphApi.DashboardIncrementCount");
        }

        public void IncrementCount()
        {
            Trace.Write("Begin Request", "GraphApi.DashboardIncrementCount");
            MakeRestRequest("dashboard.incrementCount");
            Trace.Write("End Request", "GraphApi.DashboardIncrementCount");
        }

    }
}